package sj.sj1_2;

public class TalkSpring {

    private String words = null;
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getWords() {
        return words;
    }

    public void setWords(String words) {
        this.words = words;
    }

    /**
     * 构造方法
     */
    public TalkSpring() {}
    public TalkSpring(String words) {
        this.words = words;
    }

    /**
     * 输出方法1（上机1）
     */
    public void print1(){
        System.out.println(this.getWords());
    }

    /**
     * 输出方法2（上机2）
     */
    public void print2(){
        System.out.println(this.getName()+this.getWords());
    }

}
